import {ASSETS_TYPE} from './const'

export default function initAssetRegisters(Vue) {
  ASSETS_TYPE.forEach(type => {
    Vue[type] = function(id, definition) {
      if(type === 'component') {
        // 注册全局组件
        definition = this.options._base.extend(definition)
        
      }else if(type == 'filter') {

      }else if(type == 'directive'){

      }
      this.options[type+'s'][id] = definition
    }
  })
}